﻿using ProtoBuf;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;


namespace KC.Framework.Base
{
    [Serializable, DataContract(IsReference = true), ProtoContract]
    public abstract class PropertyAttributeBase : Entity
    {
        public PropertyAttributeBase()
        {
            DataType = AttributeDataType.String;
        }

        [Key]
        [DataMember]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)] //数据库生成默认值
        public int PropertyAttributeId { get; set; }

        [DataMember]
        public AttributeDataType DataType { get; set; }

        [MaxLength(256)]
        [DataMember]
        public string Name { get; set; }
        [MaxLength(4000)]
        [DataMember]
        public string Value { get; set; }
        [MaxLength(4000)]
        [DataMember]
        public string Value1 { get; set; }
        [MaxLength(4000)]
        [DataMember]
        public string Value2 { get; set; }

        [DataMember]
        public bool CanEdit { get; set; }

        [DataMember]
        public bool IsProviderAttr { get; set; }

        [DataMember]
        public int Index { get; set; }
    }
}
